#include "Cooker.h"
#include "ObjPhysicsReader.h"

Cooker::Cooker(tstring input, tstring output):m_InputFile(input),m_OutputFile(output)
{
}

Cooker::~Cooker(void)
{
}

bool Cooker::StartCooking()
{
	bool inputSucceeded = ReadInputFile();
	if ( inputSucceeded ){
		return this->Cook();
	}else 
		return false;
}

bool Cooker::ReadInputFile()
{
	ObjPhysicsReader reader(m_InputFile);
	bool read = reader.Read();
	if ( !read )
		return false;
	m_Meshes.assign(reader.GetInputMeshBegin(),reader.GetInputMeshEnd());
	if ( m_Meshes.size() > 0)
		return true;
	else
		return false;
}